//	ID : pallab81
// 	PROG : disjoint-set
// 	LANG : C++
// 	2011-07-10-14.47.18 Sunday
//
// 	"I have not failed, I have just found 10000 ways that won't work.
//

//complexity of O(N + Q).
//http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=disjointDataStructure
#include <iostream>
#include <algorithm>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>

#include <cassert>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstring>

using namespace std;

#define fo(i,ed) for(int i = 0 ; i < ed ; ++i )
#define foit(i, x) for (typeof((x).begin()) i = (x).begin(); i != (x).end(); i++)
#define bip system("pause")
#define Int long long
#define pb push_back
#define SZ(X) (int)(X).size()
#define LN(X) (int)(X).length()
#define mk make_pair
#define f first
#define s second
#define SET( ARRAY , VALUE ) memset( ARRAY, VALUE , sizeof(ARRAY) )

const int inf = (int)1e5;
Int parent[ inf ];
Int rank[ inf ];

inline void _Make(){
    int i;
    for(i=0;i<inf;++i){
        parent[i]=i;
        rank[i]=0;
    }
}
inline Int _Find(Int now_node){
    assert( now_node < inf );
    if( now_node != parent[ now_node ] ){
        parent[ now_node ] = _Find(  parent[now_node] );
    }
return parent[ now_node ];
}
inline void _Union(Int node_x, Int node_y ){
    assert( node_x < inf );
    assert( node_y < inf );
    Int parent_x = _Find( node_x );
    Int parent_y = _Find( node_y );

    if( rank[ parent_x ] > rank[ parent_y ] ){
        parent[ parent_y ] = parent_x;
    }
    else{
        parent[ parent_x ] = parent_y;
    }
    if( rank[ parent_x ] == rank [ parent_y ] ){
        rank[ parent_y ]+=1;
    }
}

int main(){



return 0;
}

